package VO;

import java.util.ArrayList;

import User.*;

public class AdminstratorListVO extends UserListVO{
	ArrayList<AdminstratorVO> Adminstratorlist = new ArrayList<AdminstratorVO>();
	String AdminstratorID="";
	
	public AdminstratorListVO(){}
	
	public AdminstratorListVO(ArrayList<AdminstratorVO>  alist){
		Adminstratorlist=alist;
		init();
	}
	public AdminstratorListVO(AdminstratorList  admlist){
		for(Adminstrator a: admlist.getAdminstratorlist()){
			AdminstratorVO admvo=new AdminstratorVO(a);
			Adminstratorlist.add(admvo);
		}
		AdminstratorID=admlist.getUserID();
	}
	public AdminstratorListVO(String admlistinfo[][]){
		for(String adminfo[]:admlistinfo){
			AdminstratorVO adm=new AdminstratorVO(adminfo);
			Adminstratorlist.add(adm);
		}
	}
	
	public AdminstratorListVO(AdminstratorListVO admuserlOfAll,String admidList){
		String[] gidlist=admidList.split("/");
		if(admidList.equals("")){
			for(String id:gidlist){
				AdminstratorVO admvo=admuserlOfAll.find(Long.parseLong(id));
				Adminstratorlist.add(admvo);
			}
			init();
		}
		
	}
	public void init(){
		for(AdminstratorVO adm:Adminstratorlist){
			AdminstratorID=AdminstratorID+"/"+adm.getId();
		}
	}
	public AdminstratorVO find(long id){
		AdminstratorVO adm=null;
		for(AdminstratorVO av:Adminstratorlist){
			if(av.getId()==id){
				adm=av;
				break;
			}
		}
		return adm;
	}
	public ArrayList<AdminstratorVO> getAdminstratorlist(){
		return Adminstratorlist;
	}
	public String getAdminstratorlid(){
		return AdminstratorID;
	}

}

